<template>
<mt-cell v-for="child in tree.childs" :title="child.name">
  <span slot="icon" class="{{child.icon}}"></span>
  <mt-button size="small" v-for="action in child.actions" @click="action.doClick(child)" :type="action.type">
    <span v-if="child.loading" class="fa fa-spinner fa-spin"></span>
    <span v-else>{{action.name}}</span>
  </mt-button>
</mt-cell>
</template>

<script>
import MtCell from 'mint-ui/lib/cell'
import 'mint-ui/lib/cell/style.css'
import MtButton from 'mint-ui/lib/button'
import 'mint-ui/lib/button/style.css'

export default {
  props: {
    tree: {
      type: Object,
      required: true
    }
  },
  components: {
    'mt-cell': MtCell,
    'mt-button': MtButton,
  }
}
</script>

<style>
</style>